package day14;

import java.io.*;

public class learn1 {
    public static void main(String[] args) throws IOException {
        FileWriter fileWriter=null;
        BufferedWriter bufferedWriter=null;
        try{
        //创建FileWrite对象
        fileWriter=new FileWriter("D:\\WUDownloadCache\\46.txt");
         bufferedWriter=new BufferedWriter(fileWriter);
        bufferedWriter.write("asdsjava语言开发");
        bufferedWriter.flush();
        //读
            FileReader th=new FileReader("D:\\WUDownloadCache\\46.txt");
            BufferedReader TH=new BufferedReader(th);
             String str=TH.readLine();
             while(str!=null){
                 System.out.println(str);
                 str=TH.readLine();
             }

        }catch(Exception e){
            System.out.println("有异常");
        }finally {
            bufferedWriter.close();
            fileWriter.close();

        }


    }
}
